<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let calculator = {
        x: 0,
        y: 0,
        read() {
          this.x = +prompt("x?");
          this.y = +prompt("y?");
        },
        sum() {
          return this.x + this.y;
        },
        mul() {
          return this.x * this.y;
        },
      };
      calculator.read();
      console.log(calculator);
      console.log(calculator.sum());
      console.log(calculator.mul());
    </script>
  </body>
</html>
